//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first
#define Y                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)

int s = 0;
const int MAXN = 3000;
int t;
int N;
int c[MAXN][MAXN];
int f[MAXN][MAXN];
int q[2*MAXN];
int level[MAXN];

bool bfs() {
	int it = 0, it2 = 0;
	q[it2++] = s;
	memset(level,-1,sizeof(level));
	level[s] = 0;
	while(it<it2) {
		int v = q[it++];
		FOR(to,0,N) {
			if( level[to]==-1 && f[v][to] < c[v][to] ) {
				q[it2++] = to;
				level[to] = level[v]+1;
			}
		}
	}
	return level[t]!=-1;
}

int dfs(int v, int flow) {
	if(v==t || !flow) return flow;
	FOR(to,0,N) {
		if( level[v]+1==level[to] && c[v][to] > f[v][to]) {
			int pushed = dfs(to, min(flow, c[v][to]-f[v][to]) );
			if(pushed) {
				f[v][to] += pushed;
				f[to][v] -= pushed;
				return pushed;
			}
		}
	}
	return 0;
}

int dinic() {
	int flow = 0;
	while(bfs()) {
		while(int df = dfs(s,INF))
			flow += df;
	}
	return flow;
}

void test() {
	
	s = 0;
	t = 2;
	N = 3;
	c[0][1] = 1;
	c[1][2] = 5;
	c[0][2] = 2;
	cout << dinic() << endl;
}

int main()
{
	//test();return 0;
	int n,k;
	cin >> n >> k;
	s = 0;
	t = 1+2000+100+1;

	FOR(i,0,2000) {
		c[i+1][t] = k;

	}
	FOR(i,0,100) {
		c[s][2001+i] = 2;

	}

	FOR(i,0,n) {
		int x,y;
		scanf("%d%d",&x,&y);
		FOR(j,x,x+y) {
			c[i+2001][j+1] = 1;
		}
	}
	N = t+1;
	int d = dinic();
	if( d!=n*2 ) {
		cout << "No\n";
		return 0;
	}

	cout << "Yes\n";
	FOR(i,0,n) {
		VI r;
		FOR(j,0,2000) {
			if( f[2001+i][j+1] ) r.PB(j);
		}
		printf("%d %d\n",r[0],r[1]);
	}
	
	return 0;
}